#include <cstdio>
#include <cmath>

int su[ 100 ], c, n;

void init( )
{
    int i, j;
    bool ok;
    scanf("%d", &n);
    c = 0;
    for ( i = 2; i <= n; i++ )
    {
        ok = true;
        for ( j = 2; j <= sqrt( i ); j++ )
            if ( i % j == 0 )
            {
                ok = false;
                break;
            }
        if ( ok )
            su[ c++ ] = i;
    }
}

void work( )
{
    int f[ 151 ], i, j;
    for ( i = 0; i <= n; i++ )
        f[ i ] = 0;
    f[ 0 ] = 1;
    for ( i = 0; i < c; i++ )
        for ( j = su[ i ]; j <= n; j++ )
            if ( f[ j - su[ i ] ] )
                f[ j ] += f[ j - su[ i ] ];
    printf("%d\n", f[ n ]);
}

int main( )
{
    int t;
    scanf("%d", &t);
    while ( t-- )
    {
        init( );
        work( );
    }
    return 0;
}
